//org.jackysoft.workflow.bizness.util.SetActionStatusFunction
package org.jackysoft.workflow;

import java.util.Map;

import org.jackysoft.entity.Variable;
import org.jackysoft.entity.WorkflowEntry;
import org.jackysoft.opensymphony.workflow.FunctionProvider;
import org.jackysoft.opensymphony.workflow.WorkflowException;
import org.jackysoft.service.VariableService;


public class SetActionStatusFunction implements FunctionProvider {
	
	@Override
	public void execute(Map<String, Object> transientVars,
			Map<String, String> args, VariableService vservice)
			throws WorkflowException {
		String status = (String) args.get(TechActionStatus.STATUSNAME.toString());
		if (status == null)
			throw new IllegalArgumentException("未设置适当的参数 ["
					+ TechActionStatus.STATUSNAME + "]");
		WorkflowEntry entry = (WorkflowEntry) transientVars.get("entry");
		Variable wv = new Variable(entry.getId(),TechActionStatus.STATUSNAME.toString(),status);
		vservice.setVariable(wv);
		
	}



}
